安装单机版Consul
点击上方"IT牧场",选择"设为星标"技术干货每日送达!
TIPS
本文基于Consul 1.5.3,理论适用于Consul 1.6及更低版本
下载Consul
•下载最新稳定版:https://www.consul.io/downloads.html[1]•下载指定版本:https://releases.hashicorp.com/consul/[2]
百度盘加速器(Consul 1.5.3)
链接: https://pan.baidu.com/s/1Kyw5_duxW2TvEqb17YV9WQ
提取码: kfjt 复制这段内容后打开百度网盘手机App,操作更方便哦
需要的端口
Use | Default Ports |
DNS: The DNS server (TCP and UDP) | 8600 |
HTTP: The HTTP API (TCP Only) | 8500 |
HTTPS: The HTTPs API | disabled (8501)* |
gRPC: The gRPC API | disabled (8502)* |
LAN Serf: The Serf LAN port (TCP and UDP) | 8301 |
Wan Serf: The Serf WAN port TCP and UDP) | 8302 |
server: Server RPC address (TCP Only) | 8300 |
Sidecar Proxy Min: Inclusive min port number to use for automatically assigned sidecar service registrations. | 21000 |
Sidecar Proxy Max: Inclusive max port number to use for automatically assigned sidecar service registrations. | 21255 |
检查端口是否被占用的方法:
Windows:
# 如果没有结果说明没有被占用
netstat -ano| findstr "8500"
Linux:
# 如果没有结果说明没有被占用
netstat -antp |grep 8500
macOS:
# 如果没有结果说明没有被占用
netstat -ant | grep 8500
或
lsof -i:8500
安装 & 启动
•
解压下载下来的压缩包,将目录切换到 consul
所在目录
•
执行如下命令即可:
./consul agent -dev -ui -client 0.0.0.0
•
验证是否成功
./consul -v
•
访问Consul首页 localhost:8500
,可正常访问页面。
启动参数
TIPS
目前暂时可以不关注,在后面Consul高可用一节,会列出所有常用的Consul启动参数。
•-ui: 开启ui页面•-client: 让consul server拥有client的功能,允许接受服务注册;0.0.0.0表示允许使用任意IP连接Consul,如果不指定,那么只能用loalhost去连接。•-dev: 表示以开发模式运行Consul
在线Consul
•Consul官方提供:https://demo.consul.io
•itmuch提供:http://consul.itmuch.com:8500
参考文档
•Install Consul[3]
干货分享
最近将个人学习笔记整理成册,使用PDF分享。关注我,回复如下代码,即可获得百度盘地址,无套路领取!
•001:《Java并发与高并发解决方案》学习笔记;•002:《深入JVM内核——原理、诊断与优化》学习笔记;•003:《Java面试宝典》•004:《Docker开源书》•005:《Kubernetes开源书》•006:《DDD速成(领域驱动设计速成)》•007:全部•008:加技术讨论群
References
[1]
: https://www.consul.io/downloads.html[2]
: https://releases.hashicorp.com/consul/[3]
Install Consul: https://www.consul.io/docs/install/index.html
想知道更多?长按/扫码关注我吧↓↓↓